<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<AvansRS.Domain.Group>" %>

<asp:Content id="headContent" ContentPlaceHolderID="HeadContent" runat="Server">
	<link href="../../Content/AutoComplete.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="../../Scripts/jquery-1.3.2.js"></script>
	<script type="text/javascript" src="../../Scripts/jquery.autocomplete.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#Leader").autocomplete('<%= Url.Action("FindPerson", "Group") %>');
		});
	</script>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

	<h2>Create groep</h2>

    <%= Html.ValidationSummary("Create was unsuccessful. Please correct the errors and try again.") %>

    <% using (Html.BeginForm()) {%>    
        <fieldset>
            <legend>Groepgegevens</legend>
            <p>
                <label for="Name">Naam:</label>
                <%= Html.TextBox("Name", Model.Name) %>
                <%= Html.ValidationMessage("Name", "*") %>
            </p>
            <p>
					<label for="GroupType">Groep type: </label>
					<%= Html.DropDownList("GroupType", ViewData["GroupTypeList"] as IList<SelectListItem>)%>
					<%= Html.ValidationMessage("GroupType", "*")%>
            </p>
            <p>
					<label for="Leader">Leider (Gebruikersnaam):</label>
					<%= Html.TextBox("Leader") %>
					<%= Html.ValidationMessage("Leader", "*") %>
				</p>
        </fieldset>     
        <p>
            <input type="submit" value="Bewaar groep" />
        </p>

    <% } %>

    <div>
        <%=Html.ActionLink("Back to List", "Index", new { type = Session["type"] })%>
    </div>


</asp:Content>
